//
//  HHViewController.m
//  QRTest
//
//  Created by shiwanjun on 14-4-16.
//  Copyright (c) 2014年 com.gewara. All rights reserved.
//

#import "HHViewController.h"
#import "HHQReaderViewController.h"
@interface HHViewController ()
@property(nonatomic,strong)HHQReaderViewController *qreaderViewController;
@end

@implementation HHViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.qreaderViewController = [[HHQReaderViewController alloc] init];
    self.qreaderViewController.view.backgroundColor = [UIColor clearColor];
    
    CGRect rect = self.view.bounds;
    rect.origin.y = 50;
    self.qreaderViewController.view.frame = rect;
    [self.view addSubview:self.qreaderViewController.view];
    [self addChildViewController:self.qreaderViewController];
    
    
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(BtnClick:)];
    self.navigationItem.rightBarButtonItem = item;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark -- Events
-(void)BtnClick:(UIButton *)btn
{
    [self.qreaderViewController startQReader];
}

@end
